﻿#ifndef CCorrectCtrMange_H
#define CCorrectCtrMange_H
/********************************************************************************
** @ Date:2025/04/18
** @ Author: HanJiaXin
** @ Description:纠偏设备modbus控制线程类
** @ Version:1.0.0
** @ ClassName:
** @ Fun:
********************************************************************************/
#include <QThread>
#include "CDevDataBeltRealign.h"
#include "CCorrectCtrOper.h"

class CCorrectCtrMange  : public QThread
{
	Q_OBJECT

public:
	CCorrectCtrMange(CDevDataBeltRealign* pDevData);
	~CCorrectCtrMange();

	bool CtrDevice(SCtrInfo& stCtrInfo);
	bool CtrDeviceEx(SCtrInfo& stCtrInfo);
	void threadStart();
	void threadStop();

protected:
	void run() override;

private:
	QVector<SCtrInfo>m_vecCtrQueue;
	bool m_bShouldStop;
	bool m_bFrist;                           //是否是首次开启线程，防止重启启动设备的时候频繁创建线程
	std::atomic<bool>      m_bhread;         //线程状态
	int  m_nCount;
	QMutex   *m_pMutex;
	CDevDataBeltRealign *m_pDevDataBeltRealign;
	CCorrectCtrOper *m_pCtrOper;             //纠偏设备操作类对象
};
#endif